.class Lcom/baidu/ah;
.super Ljava/lang/Thread;


# instance fields
.field final synthetic a:Landroid/app/Activity;

.field final synthetic b:Lcom/baidu/AppActivity;


# direct methods
.method constructor <init>(Lcom/baidu/AppActivity;Landroid/app/Activity;)V
    .locals 0

    iput-object p1, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    iput-object p2, p0, Lcom/baidu/ah;->a:Landroid/app/Activity;

    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 7

    const/4 v6, 0x0

    :try_start_0
    iget-object v0, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    const/4 v1, 0x1

    invoke-static {v0, v1}, Lcom/baidu/AppActivity;->a(Lcom/baidu/AppActivity;Z)V

    iget-object v0, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-virtual {v0}, Lcom/baidu/AppActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "curl"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "fetch app detail: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/baidu/bk;->b(Ljava/lang/String;)I

    iget-object v1, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    iget-object v2, p0, Lcom/baidu/ah;->a:Landroid/app/Activity;

    iget-object v3, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-virtual {v3}, Lcom/baidu/AppActivity;->getIntent()Landroid/content/Intent;

    move-result-object v3

    const-string v4, "clklogurl"

    invoke-virtual {v3, v4}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    new-instance v4, Lorg/json/JSONObject;

    iget-object v5, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-static {v5}, Lcom/baidu/AppActivity;->a(Lcom/baidu/AppActivity;)Landroid/widget/ImageView;

    move-result-object v5

    invoke-virtual {v5}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v5, v0}, Lcom/baidu/w;->d(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v4, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    invoke-static {v2, v3, v4}, Lcom/baidu/App;->a(Landroid/content/Context;Ljava/lang/String;Lorg/json/JSONObject;)Lcom/baidu/App;

    move-result-object v0

    invoke-static {v1, v0}, Lcom/baidu/AppActivity;->a(Lcom/baidu/AppActivity;Lcom/baidu/App;)Lcom/baidu/App;

    invoke-static {}, Lcom/baidu/AppActivity;->a()Ljava/util/List;

    move-result-object v0

    iget-object v1, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-static {v1}, Lcom/baidu/AppActivity;->b(Lcom/baidu/AppActivity;)Lcom/baidu/App;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-static {}, Lcom/baidu/AppActivity;->a()Ljava/util/List;

    move-result-object v0

    iget-object v1, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-static {v1}, Lcom/baidu/AppActivity;->b(Lcom/baidu/AppActivity;)Lcom/baidu/App;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :cond_0
    iget-object v0, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-static {v0}, Lcom/baidu/AppActivity;->d(Lcom/baidu/AppActivity;)Landroid/os/Handler;

    move-result-object v0

    new-instance v1, Lcom/baidu/ai;

    invoke-direct {v1, p0}, Lcom/baidu/ai;-><init>(Lcom/baidu/ah;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    iget-object v0, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/baidu/AppActivity;->a(Lcom/baidu/AppActivity;Z)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    return-void

    :catch_0
    move-exception v0

    iget-object v1, p0, Lcom/baidu/ah;->b:Lcom/baidu/AppActivity;

    invoke-static {v1, v6}, Lcom/baidu/AppActivity;->a(Lcom/baidu/AppActivity;Z)V

    invoke-static {v0}, Lcom/baidu/bk;->a(Ljava/lang/Throwable;)I

    goto :goto_0
.end method
